import React, { PropTypes } from 'react';

const propTypes = {
  id: PropTypes.number,
  text: PropTypes.string,
};

const defaultProps = {
  text: 'Hello World',
};

class Reply extends React.Component {
  constructor(props) {
    super(props);
    // return false;
  }
  static methodsAreOk() {
    return true;
  }
  componentWillMount() {
    console.log('componentWillMount');
    return false;
  }
  componentDidMount() {
    console.log('componentDidMount');
    return false;
  }
  componentWillReceiveProps() {
    console.log('componentWillReceiveProps');
    return false;
  }
  shouldComponentUpdate() {
    return true;
  }
  componentWillUpdate() {
    console.log('componentWillUpdate');
    return false;
  }
  componentDidUpdate() {
    console.log('componentDidUpdate');
    // return false;
  }
  componentWillUnmount() {
    console.log('componentWillUnmount');
    // return false;
  }
  clickHandlers() {
    console.log('clicked');
    alert('post')
    // return false;
  }
  render() {
    return (
	    <section className="reply">
	        <textarea id="content" rows="8" className="text"
	            className="{'err':hasErr}"
	            placeholder='回复支持Markdown语法,请注意标记代码' defaultValue={this.props.replyTo?`@${this.props.replyTo} `:''}>
	        </textarea>
	        <a className="button" onClick={this.clickHandlers.bind(this)}>确定</a>
	    </section>
    );
  }
}

Reply.propTypes = propTypes;
Reply.defaultProps = defaultProps;

export default Reply;